using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using T2.WebSecurity.Data.Controllers.Interfaces;
using T2.WebSecurity.Data.Entities.Interfaces;
using T2.WebSecurity.Business.Entities.Interfaces;
using T2.WebSecurity.Business.Entities;
using T2.WebSecurity.Data.Controllers;
using T2.WebSecurity.Business.Builders.Interface;
using T2.WebSecurity.Business.Translators;
using T2.WebSecurity.Business.Entities.Search.Interfaces;
using T2.WebSecurity.Data.Entities.Search.Interfaces;


//--Change Management Control - ApplicationUser Builder  --**********************
//--Created By: trooks
//--Description: ApplicationUser Builder Class
//--Created Date: 03/07/2013 10:49:09
//--*************************************************************

namespace T2.WebSecurity.Business.Builders
{
	public partial class ApplicationUser_Builder : IApplicationUser_builder 
	{
		
	public List<IApplicationUser_biz> BuildParts (IApplicationUser_biz _param)
	{
			IApplicationUser_biz temp = new ApplicationUser_biz();
			IApplicationUserController cont = new ApplicationUserController();
			List<IApplicationUser_biz> tempList = new List<IApplicationUser_biz>();
			List<IApplicationUser> tempData = new List<IApplicationUser>();
			switch (_param.Action)
			{
				case "GetOne":
				temp = ApplicationUserTranslator.TranslateFromDataLayer(cont.ApplicationUser_GetOne(ApplicationUserTranslator.TranslateToDataLayer(_param)));
				tempList.Add(temp);
				return tempList;

				case "GetAll":
				tempData = cont.ApplicationUser_GetAll(ApplicationUserTranslator.TranslateToDataLayer(_param));
				tempList = tempData.Select(p => ApplicationUserTranslator.TranslateFromDataLayer(p)).Cast<IApplicationUser_biz>().ToList();
				return tempList;

				case "UserProfile_ApplicationUser_ByParent":
				tempData = cont.UserProfile_ApplicationUser_ByParent(ApplicationUserTranslator.TranslateToDataLayer(_param));
				tempList = tempData.Select(p => ApplicationUserTranslator.TranslateFromDataLayer(p)).Cast<IApplicationUser_biz>().ToList();
				return tempList;

				case "Application_ApplicationUser_ByParent":
				tempData = cont.Application_ApplicationUser_ByParent(ApplicationUserTranslator.TranslateToDataLayer(_param));
				tempList = tempData.Select(p => ApplicationUserTranslator.TranslateFromDataLayer(p)).Cast<IApplicationUser_biz>().ToList();
				return tempList;

			}
			return tempList;
}
	public List<IApplicationUser_biz> BuildParts (IApplicationUserSearch_biz _param)
	{
			IApplicationUser_biz temp = new ApplicationUser_biz();
			IApplicationUserController cont = new ApplicationUserController();
			List<IApplicationUser_biz> tempList = new List<IApplicationUser_biz>();
			List<IApplicationUser> tempData = new List<IApplicationUser>();
			tempData = cont.ApplicationUser_Search(ApplicationUserTranslator.TranslateSearchToDataLayer(_param));
			tempList = tempData.Select(p => ApplicationUserTranslator.TranslateFromDataLayer(p)).Cast<IApplicationUser_biz>().ToList();
			return tempList;

	}
		
	}
}
